from flask import Flask
import pymysql
from dbutils.pooled_db import PooledDB
from sqlhelp_class import db

app = Flask(__name__)


@app.route("/")
def home():
    result = db.fetchone(
        "select * from user where name = %s and pwd = %s ", "木婉清", "123456"
    )
    print(result)
    return "home"


@app.route("/index")
def index():
    print(db.fetchall("select * from user"))
    return "index"


if __name__ == "__main__":
    app.run(debug=True)
